var express = require('express');
const { from } = require('form-data');
var formidable=require('formidable');
var router = express.Router();
/* GET home page. */
router.get('/', function(req, res, next) {
  res.render('index', { title: 'Express' });
});
router.post("/login",function(req,res,next) {
  const form=formidable({multiples: true});
  form.parse(req,(err,fields,files)=>{
      if(err){
        res.render('index', { title: 'error' });
      }
      console.log(fields,"form-data:");
  });
   console.log(req.body,"body");
   res.render("index",{title: 'post'}); 
});
module.exports = router;
